package com.taxi.remote;

import com.taxi.dto.OrderDetailInfo;
import com.taxi.dto.OrderInfo;
import com.taxi.request.OrderRequest;
import com.taxi.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;

/**
 * @Author: aniu
 * @Date: 2023/10/3
 * @ClassName: ServiceOrderClient
 * @Description: Write class functionality and purpose here.
 * @Version: 1.0
 */
@FeignClient("service-order")
public interface ServiceOrderClient {
    @PostMapping("/order/add")
    public Result add(@RequestBody OrderRequest orderRequest);

    @GetMapping("/test-real-time-order/{orderId}")
    public Result dispatchRealTimeOrder(@PathVariable long orderId);

    @PostMapping("/order/cancel")
    public Result cancel(@RequestParam Long orderId, @RequestParam String identity);

    @GetMapping("/order/current/{phone}/{identity}")
    public Result<OrderInfo> current(@PathVariable String phone , @PathVariable String identity);

    @GetMapping("/order/current-order-detail")
    public Result<OrderDetailInfo> currentOrderDetail(@RequestParam Long orderId);

    @GetMapping("/order/get-all-orders/{phone}/{identity}")
    public Result<ArrayList<OrderInfo>> getAllOrders(@PathVariable String phone , @PathVariable String identity);

}
